<script setup>
import useArticleStore from '@/stores/article/index.js'

const articleStore = useArticleStore()

const onLoadingView = () => {
  articleStore.isLoading = false
}
</script>

<template>
  <div class="loading" v-if="articleStore.isLoading" @click="onLoadingView">
    <div class="bg">
      <div class="bg">
        <img src="@/assets/images/full-screen-loading.gif" />
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">
.loading {
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);

  .bg {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 104px;
    height: 104px;
  }

  img {
    margin-bottom: 8px;
    width: 70px;
    height: 70px;
  }
}
</style>
